﻿<%@ Page Title="Manage user's possesions" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ManageUsersPossessions.aspx.cs" Inherits="TeamPrasioliteWarGame.Admin.ManageUsersPossessions" %>

<asp:Content ID="ManageUserPossessions" ContentPlaceHolderID="MainContent" runat="server">
    <h1>
        <asp:Label ID="PageTitle" runat="server" />
    </h1>
    <asp:GridView runat="server" ID="GridViewUserBuildings"
        AllowPaging="true"
        PageSize="5"
        ItemType="TeamPrasioliteWarGame.Models.UserBuilding"
        DataKeyNames="buildingId"
        SelectMethod="GridViewUserBuildings_GetData"
        UpdateMethod="GridViewUserBuildings_UpdateItem"
        DeleteMethod="GridViewUserBuildings_DeleteItem"
        AutoGenerateColumns="false"
        CssClass="table-striped table-hover table table-bordered">
        <Columns>
            <asp:CommandField ShowEditButton="true" ShowDeleteButton="true" />
            <asp:TemplateField HeaderText="Building Type">
                <ItemTemplate>
                    <%#: Item.Building.Type %>
                </ItemTemplate>
                <EditItemTemplate>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Building Level">
                <ItemTemplate>
                    <%#: Item.BuildingLevel %>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox runat="server" ID="TextBoxEditBuildingLevel" Text="<%#: BindItem.BuildingLevel %>" />
                </EditItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>

    <asp:GridView runat="server" ID="GridViewUserUnits"
        AllowPaging="true"
        PageSize="5"
        ItemType="TeamPrasioliteWarGame.Models.UserUnit"
        DataKeyNames="unitId"
        SelectMethod="GridViewUserUnits_GetData"
        UpdateMethod="GridViewUserUnits_UpdateItem"
        DeleteMethod="GridViewUserUnits_DeleteItem"
        AutoGenerateColumns="false"
        CssClass="table-striped table-hover table table-bordered">
        <Columns>
            <asp:CommandField ShowEditButton="true" ShowDeleteButton="true" />
            <asp:TemplateField HeaderText="Unit Type">
                <ItemTemplate>
                    <%#: Item.GameUnit.Type %>
                </ItemTemplate>
                <EditItemTemplate>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Unit Count">
                <ItemTemplate>
                    <%#: Item.Count %>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox runat="server" ID="TextBoxEditBuildingLevel" Text="<%#: BindItem.Count %>" />
                </EditItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>

    <%--user resourses--%>
    <asp:DetailsView runat="server" ID="DetailsViewUserResourses" ItemType="TeamPrasioliteWarGame.Models.ExtendUser"
        SelectMethod="DetailsViewUserResourses_GetItem"
        UpdateMethod="DetailsViewUserResourses_UpdateItem"
        DataKeyNames="UserId"
        AutoGenerateRows="false"
        CssClass="table-striped table-hover table table-bordered">
        <Fields>
            <asp:TemplateField HeaderText="Food">
                <ItemTemplate>
                            <%#: Item.Food %>
                </ItemTemplate>
                <EditItemTemplate>
                            <asp:TextBox runat="server" ID="TextBoxFood" Text="<%#: BindItem.Food %>" /> 
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Wood">
                <ItemTemplate>
                    
                             <%#: Item.Wood %>
                </ItemTemplate>
                <EditItemTemplate> 
                            <asp:TextBox runat="server" ID="TextBoxWood" Text="<%#: BindItem.Wood %>" /> 
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Iron">
                <ItemTemplate>
                            <%#: Item.Iron %>
                </ItemTemplate>
                <EditItemTemplate>
                            <asp:TextBox runat="server" ID="TextBoxIron" Text="<%#: BindItem.Iron %>" /> 
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:CommandField ShowEditButton="true" />
        </Fields>
    </asp:DetailsView>

    <a href="ManageAllUsers.aspx">Back to users</a>
</asp:Content>
